#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int a = 0;
	while (scanf("%d", &a) != EOF)
	{
		char arr[15] = {0};
		int i = 0; int n = 0;
		while (a)
		{
			if (n != 0 && n % 3 == 0)
			{
				arr[i] = ',';
				i++;
			}
			arr[i] = a % 10 + '0';
			n++;
			a = a / 10;
			i++;

		}
		for (int j = i - 1; j >= 0; j--)
		{
			printf("%c",arr[j]);
		}

	}


	return 0;
}